﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace QuickModel.InteractiveOperation.CmdTestInteractiveOperation
{
	[Grouper(GrouperName = "TestCurveRequest")]
	internal class TestCurveGroup : IDataGrouper
	{
		public List<RevitModelRequest> GroupData(InputRequest inputRequest)
		{
			List<RevitModelRequest> list = new List<RevitModelRequest>();
			try
			{
				List<CurveInfo> list2 = inputRequest.SelectDataMap.First<KeyValuePair<string, List<ICadElement>>>().Value.ConvertAll<CurveInfo>((ICadElement item) => item as CurveInfo);
				foreach (CurveInfo item2 in list2)
				{
					TestCurveCadElement testCurveCadElement = new TestCurveCadElement();
					testCurveCadElement.LstCurveElements = new List<CurveCadElement>();
					testCurveCadElement.LstCurveElements.Add(item2);
					list.Add(new TestCurveRevitModelRequest
					{
						RequestData = testCurveCadElement
					});
				}
			}
			catch (Exception)
			{
			}
			return list;
		}
	}
}
